﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//
using Model;
using DAL;

namespace BLL
{
    public class ArticlesBLL
    {
        ArticlesDAL dal = new ArticlesDAL();
        //查询所有帖子
        public List<Articles> GetAll()
        {
            return dal.GetAll();
        }
        //查询帖子详情
        public Articles GetById(int id)
        {
            return dal.GetById(id);
        }

        //查询帖子评论
        public List<Pingluns> GetPinglunsById(int id)
        {
            return dal.GetPinglunsById(id);
        }

        //点赞
        public bool Zan(int id)
        {
            return dal.Zan(id);
        }
        //踩
        public bool Cai(int id)
        {
            return dal.Cai(id);
        }
        //浏览
        public bool Dian(int id)
        {
            return dal.Dian(id);
        }


        //按条件查询
        public List<Articles> GetAllByTiao(string stxt)
        {
            return dal.GetAllByTiao(stxt);
        }

        //发帖
        public bool Add(Articles a)
        {
            return dal.Add(a);
        }

        //发表评论
        public bool AddPinglun(Pingluns p)
        {
            return dal.AddPinglun(p);
        }
        //按用户查询帖子
        public List<Articles> GetArticlesByUser(int id)
        {
            return dal.GetArticlesByUser(id);
        }

        //删除
        public bool Del(int id)
        {
            return dal.Del(id);
        }

        //修改
        public bool Update(Articles update)
        {
            return dal.Update(update);
        }
    }
}
